simplification of continued fraction